import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'
import Login from '@/pages/login'
import AuthRoute from '@/components/AuthRoute'
import Layout from '@/pages/layout'
function App() {
  return (
    <Router>
      <div className='App'>
        <Route
          exact
          path='/'
          //render  接收自定义内容
          render={() => {
            //Redirect 重定向  to属性为重定向的路由
            return <Redirect to='/home'></Redirect>
          }}
        ></Route>
        <Route exact path='/login' component={Login}></Route>
        <AuthRoute path='/home' component={Layout}></AuthRoute>
      </div>
    </Router>
  )
}

export default App
